<template>
    <div class="main">
        <img :src="getIcon(this.icon)" alt="">
        <p>{{text}}</p>
    </div>
</template>

<script type="text/ecmascript-6">
  import Public from '@/assets/js/public';

  export default {
    /** kebab-case */
    name: 'mem-search-item-sec-top',

    data() {
      return {};
    },
    props: {
      // 文本
      text: {
        type: String,
        require: true
      },
      // 图标
      icon: {
        type: String,
        required: true
      }
    },
    components: {},
    methods: {
      getIcon(icon) {
        return Public.ossImg + icon + '.svg';
      }
    },
    computed: {},
    watch: {
      // 监听具体数据变化，并做相应的处理
    },
    beforeCreate() {
      /** 可以在这加个loading事件，在加载实例时触发 */
      // 这个阶段实例的data、methods是读不到的
    },
    created() {}
  };
</script>

<style lang="stylus" rel="stylesheet/stylus" scoped>
    @import "../../assets/stylus/main.styl";
    .main {
        flex-x();
        height: vw(56px)
        background #ffffff
        width 100%;
        justify-content: flex-start
        & img {
            width 6vw;
            padding-right 6vw
        }
    }

    .flex-r
        flex-x()

    .flex-c
        flex-y()

    .center
        flex-center()

    .divider
        divider()

    .space
        space()
</style>
